<?php

class DB {
  private static $instance;
  
  private function __construct() {
    require_once('../config.php');
    $this->connection = mysql_connect($dbserver,$dbuser,$dbpass);
  }
  
  public static function me() {
    if (!isset(self::$instance)) {
      $c = __CLASS__;
      self::$instance = new $c;
    }
    return self::$instance;
  }
  
  //We need to disallow cloning
  public function __clone()
  {
    trigger_error('This singleton cannot bwe cloned.', E_USER_ERROR);
  }
}

?>